package com.nchu.service.impl;

import com.nchu.mappers.UserMapper;
import com.nchu.pojo.OrderComplain;
import com.nchu.pojo.User;
import com.nchu.pojo.UserAddress;
import com.nchu.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Date:2023-07-11 11:26
 * Author：whx
 */
@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper mapper;
    public User login(int userid, String pwd) {
        return mapper.login(userid,pwd);
    }

    public int register(User user) {

        return mapper.register(user);
    }

    public User userisexist(int userid) {
        return mapper.userisexist(userid);
    }

    public List<UserAddress> FindAddressbyid(int userid) {
        return mapper.FindAddressbyid(userid);
    }

    public int changeaddress1(int serialnumber) {
        return mapper.changeaddress1(serialnumber);
    }

    public int changeaddress0(int userid) {
        return mapper.changeaddress0(userid);
    }

    public UserAddress address(int serialnumber) {
        return mapper.address(serialnumber);
    }

    public int updateaddress(int serialnumber, String name, String address, String phone) {
        return mapper.updateaddress(serialnumber,name,address,phone);
    }

    public int deleteaddress(int serialnumber) {
        return mapper.deleteaddress(serialnumber);
    }

    public int addaddress(int userid, String name, String address, String phone) {
        return mapper.addaddress(userid,name,address,phone);
    }


    public int changepwd(int userid,String pwd){
        return mapper.changepwd(userid,pwd);
    }

    public int UpdateUserById(int userid,String username,String phone) {
        return mapper.UpdateUserById(userid,username,phone);
    }





    public List<OrderComplain> findallcomplainbyid(int complainantid) {
        return mapper.findallcomplainbyid(complainantid);
    }

    ;

}
